package com.facade.facade;

/**
 * DVD类
 * 为了回顾以前的知识使用单例模式实现 - 使用一个双重检查
 */
public class DVDPlayer {

    private static volatile DVDPlayer dvdPlayer = null ;

    private DVDPlayer(){}

    public static DVDPlayer getInstance(){
        if (dvdPlayer == null){
            synchronized (DVDPlayer.class){
                if (dvdPlayer == null){
                    dvdPlayer = new DVDPlayer();
                }
            }
        }
        return dvdPlayer;
    }

    public void on(){
        System.out.println(" DVD  on ... ");
    }

    public void off(){
        System.out.println(" DVD  off ... ");
    }

    public void play(){
        System.out.println(" DVD  play ... ");
    }

    public void pause(){
        System.out.println(" DVD  pause ... ");
    }
}
